﻿function getquery(name, url) {
    // 获取URL地址参数

    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    if (!url || url == "") {
        url = window.location.href;
    } else {
        url = url.substring(url.indexOf("?"));
    }
    r = url.substr(1).match(reg)
    if (r != null)
        return unescape(r[2]);
    return null;
}
function htmldoc(fn) {
    return fn.toString().split('\n').slice(1, -1).join('\n') + '\n'
}